/**
 * Description: Hello World!
 * author: 何雨轩
 * Create at: 18/8/7 下午4:58
 */

// 饿汉式
public class Singleton1 {
    //私有的默认构造子
    private Singleton1() {
    }

    //已经自行实例化
    private static final Singleton1 single = new Singleton1();

    //静态工厂方法
    public static Singleton1 getInstance() {
        return single;
    }
}